// amalgated from twitter bootstrap

//
// Variables
// --------------------------------------------------

//== Typography
//
//## Font, line-height, and color for body text, headings, and more.

@font-family-sans-serif:  "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-family-serif:       Georgia, "Times New Roman", Times, serif;
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
@font-family-monospace:   Menlo, Monaco, Consolas, "Courier New", monospace;
@font-family-base:        @font-family-sans-serif;

@font-size-base:          14px;
@font-size-large:         ceil((@font-size-base * 1.25)); // ~18px
@font-size-small:         ceil((@font-size-base * 0.85)); // ~12px

@font-size-h1:            2em;
@font-size-h2:            1.75em;
@font-size-h3:            1.5em;
@font-size-h4:            1.25em;
@font-size-h5:            1.15em;
@font-size-h6:            1.1em;

//** Unit-less `line-height` for use in components like buttons.
@line-height-base:        1.428571429; // 20/14
//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
@line-height-computed:    floor((@font-size-base * @line-height-base)); // ~20px

//** By default, this inherits from the `<body>`.
@headings-font-family:    inherit;
@headings-font-weight:    500;
@headings-line-height:    1.1;
@headings-color:          inherit;
@headings-small-color:    #999;

//== Components
//
//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).

@padding-base-vertical:     6px;
@padding-base-horizontal:   12px;

@padding-large-vertical:    10px;
@padding-large-horizontal:  16px;

@padding-small-vertical:    5px;
@padding-small-horizontal:  10px;

@padding-xs-vertical:       1px;
@padding-xs-horizontal:     5px;

@line-height-large:         1.3333333; // extra decimals for Win 8.1 Chrome
@line-height-small:         1.5;

@border-radius-base:        4px;
@border-radius-large:       6px;
@border-radius-small:       3px;

//** Width of the `border` for generating carets that indicate dropdowns.
@caret-width-base:          4px;
//** Carets increase slightly in size for larger components.
@caret-width-large:         5px;


//== Tables
//
//## Customizes the `.table` component with basic values, each used across all table variations.

//** Padding for `<th>`s and `<td>`s.
@table-cell-padding:            8px;
//** Padding for cells in `.table-condensed`.
@table-condensed-cell-padding:  5px;

//** Default background color used for all tables.
@table-bg:                      transparent;
//** Background color used for `.table-striped`.
@table-bg-accent:               #f9f9f9;
//** Background color used for `.table-hover`.
@table-bg-hover:                #f5f5f5;
@table-bg-active:               @table-bg-hover;

//** Border color for table and cell borders.
@table-border-color:            #ddd;


//== Code
//
//##

@code-color:                  #c7254e;
@code-bg:                     #f9f2f4;

@kbd-color:                   #fff;
@kbd-bg:                      #333;

@pre-bg:                      #f5f5f5;
@pre-color:                   #777;
@pre-border-color:            #ccc;
@pre-scrollable-max-height:   340px;


//== Type
//
//##

//** Blockquote font size
@blockquote-font-size:        (@font-size-base * 1.25);
@blockquote-border-color:     #ccc;
@blockquote-small-color:     #ccc;

.markdown {

  font-family: @font-family-base;
  font-size: @font-size-base;
  line-height: @line-height-base;

  // Headings
  // -------------------------

  h1, h2, h3, h4, h5, h6 {
    font-family: @headings-font-family;
    font-weight: @headings-font-weight;
    line-height: @headings-line-height;
    color: @headings-color;

    small {
      font-weight: normal;
      line-height: 1;
      color: @headings-small-color;
    }
  }

  h1,
  h2,
  h3 {
    margin-top: @line-height-computed;
    margin-bottom: (@line-height-computed / 2);

    small,
    .small {
      font-size: 65%;
    }
  }
  h4,
  h5,
  h6 {
    margin-top: (@line-height-computed / 2);
    margin-bottom: (@line-height-computed / 2);

    small,
    .small {
      font-size: 75%;
    }
  }

  h1 { font-size: @font-size-h1; }
  h2 { font-size: @font-size-h2; }
  h3 { font-size: @font-size-h3; }
  h4 { font-size: @font-size-h4; }
  h5 { font-size: @font-size-h5; }
  h6 { font-size: @font-size-h6; }

  // Body text
  // -------------------------

  p {
    margin: 0 0 (@line-height-computed / 2);
  }

  // Emphasis & misc
  // -------------------------

  // Ex: (12px small font / 14px base font) * 100% = about 85%
  small {
    font-size: floor((100% * @font-size-small / @font-size-base));
  }

  // Lists
  // -------------------------

  // Unordered and Ordered lists
  ul,
  ol {
    margin-top: 0;
    margin-bottom: (@line-height-computed / 2);
    ul,
    ol {
      margin-bottom: 0;
    }
  }

  // Blockquotes
  blockquote {
    padding: (@line-height-computed / 2) @line-height-computed;
    margin: 0 0 @line-height-computed;
    font-size: @blockquote-font-size;
    border-left: 5px solid @blockquote-border-color;

    p,
    ul,
    ol {
      &:last-child {
        margin-bottom: 0;
      }
    }

    // Note: Deprecated small and .small as of v3.1.0
    // Context: https://github.com/twbs/bootstrap/issues/11660
    footer,
    small {
      display: block;
      font-size: 80%; // back to default font-size
      line-height: @line-height-base;
      color: @blockquote-small-color;

      &:before {
        content: '\2014 \00A0'; // em dash, nbsp
      }
    }
  }

  //
  // Code (inline and block)
  // --------------------------------------------------


  // Inline and block code styles
  code,
  kbd,
  pre,
  samp {
    font-family: @font-family-monospace;
  }

  // Inline code
  code {
    padding: 2px 4px;
    font-size: 90%;
    color: @code-color;
    background-color: @code-bg;
    border-radius: @border-radius-base;
  }

  // User input typically entered via keyboard
  kbd {
    padding: 2px 4px;
    font-size: 90%;
    color: @kbd-color;
    background-color: @kbd-bg;
    border-radius: @border-radius-small;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);

    kbd {
      padding: 0;
      font-size: 100%;
      font-weight: 500;
      box-shadow: none;
    }
  }

  // Blocks of code
  pre {
    display: block;
    padding: ((@line-height-computed - 1) / 2);
    margin: 0 0 (@line-height-computed / 2);
    font-size: (@font-size-base - 1); // 14px to 13px
    line-height: @line-height-base;
    word-break: break-all;
    word-wrap: break-word;
    color: @pre-color;
    background-color: @pre-bg;
    border: 1px solid @pre-border-color;
    border-radius: @border-radius-base;

    // Account for some code outputs that place code tags in pre tags
    code {
      padding: 0;
      font-size: inherit;
      color: inherit;
      white-space: pre-wrap;
      background-color: transparent;
      border: 0;
    }
  }

  // Enable scrollable blocks of code
  .pre-scrollable {
    max-height: @pre-scrollable-max-height;
    overflow-y: scroll;
  }
}